Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rollup/pluginutils

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/pluginutils

A set of utility functions commonly used by Rollup plugins

  • 5.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @rollup/pluginutils?

The @rollup/pluginutils package provides a suite of utility functions commonly used by Rollup plugins. These utilities help with tasks such as filtering files to be included in the bundle, creating minimatch instances, and handling module IDs.

What are @rollup/pluginutils's main functionalities?

createFilter

createFilter allows you to create a filter function that can be used to determine whether a file should be included or excluded based on the provided include and exclude patterns.

import { createFilter } from '@rollup/pluginutils';
const filter = createFilter(include, exclude);
if (filter(somePath)) {
  // Handle the file
}

dataToEsm

dataToEsm converts a JSON object to an ES module string, which can be useful for injecting configuration or other data into your bundle.

import { dataToEsm } from '@rollup/pluginutils';
const data = { foo: 'bar' };
const esModule = dataToEsm(data);
// esModule is now a string of ESM code representing the data

addExtension

addExtension ensures that a file path has the specified extension. If it already has the extension, it returns the path unchanged.

import { addExtension } from '@rollup/pluginutils';
const filename = addExtension('myfile', '.js');
// filename is now 'myfile.js'

Other packages similar to @rollup/pluginutils

Keywords

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc